package com.expdatacloud.utils;

import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

/**
 * @author jie
 * @date 2020/3/24 -10:32
 */
public class SaveWhseIdToCookie {

    public static void setWhseIdSaveToCookie(String whseid, String users, HttpServletResponse response, HttpSession session) {


        if (users != null) {
            session.setAttribute("users", users);
        }
        if (whseid != null) {
            Cookie cookie = new Cookie("library", whseid);
            cookie.setPath("/");
            response.addCookie(cookie);
        }

    }
}
